package com.lanou.mynews.main;

import android.app.Application;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.lanou.mynews.dao.DaoMaster;
import com.lanou.mynews.dao.DaoSession;

/**
 * Created by Administrator on 2016/2/23.
 */
public class InitApplication extends Application {

    /** 数据库 */
    private SQLiteDatabase db;
    SQLiteOpenHelper helper = new DaoMaster.DevOpenHelper(this, "schoollist", null);
    private DaoMaster daoMaster;
    public static DaoSession daoSession;


    @Override
    public void onCreate() {
        db = helper.getWritableDatabase();
        daoMaster = new DaoMaster(db);
        daoSession = daoMaster.newSession();
        super.onCreate();
    }
}
